// ProblemFactory.java
import java.util.Random;

public class ProblemFactory {
    private static final Random random = new Random();

    public static Problem createAdditionProblem() {
        int operand1 = random.nextInt(10) + 1;
        int operand2 = random.nextInt(10) + 1;
        return new AdditionProblem(operand1, operand2);
    }

    public static Problem createSubtractionProblem() {
        int operand1 = random.nextInt(10) + 1;
        int operand2 = random.nextInt(10) + 1;
        return new SubtractionProblem(operand1, operand2);
    }
}